<script setup lang="ts">
import { ref } from 'vue';
import Channel from './components/Channel.vue'
import NewsList from './components/NewsList.vue'

// !#1 准备默认的 channelId，应该是第一个频道的，这儿写 0 不合适
const channelId = ref(888)

</script>

<template>
  <!-- //!#2 传递 -->
  <!-- //!#6 @监听 changeChannelId -->
  <Channel :channelId="channelId" @changeChannelId="channelId = $event" />
  <NewsList :channelId="channelId" />
</template>